<?php
include "include/config.inc.php";
$guaranterId = $_REQUEST['guaranterId'];

$guaranterParty = "SELECT loan.guaranterId, party.partyName, party.partyId
                    FROM loan
                    JOIN party ON party.partyId = loan.partyId
                   WHERE guaranterId = '".$guaranterId."'";
$guaranterPartyRes = mysql_query($guaranterParty);
?>

<h1 align="center"> Party </h1>
<table id="datatables" align="center" border="1" class="display">
  <thead>
    <tr>
      <th>Guranter Id</th>
      <th>Party Id</th>
      <th>Party Name</th>
    </tr>
  </thead>
  <tbody id="insData">
  <?php
    while($guaranterPartyRow = mysql_fetch_array($guaranterPartyRes))
    { 
  ?>
      <tr>
        <td align="center"><?php echo $guaranterPartyRow['guaranterId']; ?> </td>
        <td align="center"><?php echo $guaranterPartyRow['partyId']; ?> </td>
        <td align="center"><?php echo $guaranterPartyRow['partyName']; ?> </td>
      </tr>
    <?php
    }
    ?>
  </tbody>
</table>